#pragma once

#include "string/tstring.h"
#include <windows.h>
#include <filesystem>

namespace fs = std::filesystem;

namespace CodingSea {

class WinApi {
public:
    static inline TString GetModuleDir(const TString& strModuleName = TString())
    {
        return fs::path(GetModuleFileName(strModuleName)).parent_path();
    }

    static inline TString GetModuleDir(HMODULE hModule)
    {
        return fs::path(GetModuleFileName(hModule)).parent_path();
    }

    static TString GetModuleFileName(const TString& strModuleName = TString());
    static TString GetModuleFileName(HMODULE hModule);

    static void DrawDesktopRect(RECT& rect);
    static void DrawRect(HWND hWnd);
    static TString GetWindowText(HWND hWnd);
    static TString GetClassName(HWND hWnd);
    static HWND GetRealWindow(POINT ptPoint);
    static HWND GetCurRealWindow();
    static TString GetProcessNtPath(HANDLE hProcess);
};

} // namespace CodingSea
